package ab.mes.mapper;

import ab.mes.entity.Equipment;
import ab.mes.entity.Equipment;
import ab.mes.entity.Staff;
import ab.mes.tools.Result;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EquipmentMapper extends BaseMapper<Staff> {
    //获取设备信息
    @Select("SELECT equipment_type FROM equipment ORDER BY equipment_no DESC")
    public List<Equipment> selectEquipment1();
    //根据编号获取物料信息
    @Select("SELECT id_Of_Equipment FROM equipment WHERE id_Of_Equipment=#{id_Of_Equipment} ORDER BY id_Of_Equipment DESC")
    public List<Equipment> selectByNumber(Integer id_Of_Equipment);
    //新增物料信息
    public Result insertEquipment(Equipment equipment);
    //删除物料信息
    @Delete("delete from equipment where id_Of_Equipment=#{id_Of_Equipment}")
    public Result deleteEquipment(Integer id_Of_Equipment);
    //修改物料信息
    public Result editEquipment(Equipment equipment);

    //模糊查询功能
    @Select("select * from equipment where equipment_Specification like #{keyWord} ")
    public List<Equipment> searchEquipment(String keyWord);
}
